var t,
  i,
  a = require("../../@babel/runtime/helpers/defineProperty"),
  n = require("../../res/www.a9a.cn.js"),
  e = getApp(),
  o = 2,
  r = !0;
Page({
  data: {
    nTitle: "单身群",
    t: 0,
    triggered: !0,
    loading_flag: !1,
    loading_ico_flag: !1,
    loading_str: "玩命加载中",
  },
  onLoad: function (t) {
    var i = this;
    wx.setNavigationBarTitle({ title: i.data.nTitle }),
      e.get_config("_ZEAI").then(function (t) {
        i.setData({ color: e._ZEAI.color, rgbcolor: n.c16_rgb(e._ZEAI.color) });
      }),
      e.get_navigationBarTopHeight(i),
      this.init();
  },
  init: function () {
    var o = this;
    wx.showLoading({ title: "玩命加载中...", mask: !0 }), (r = !1);
    var s = {
      submitok: "qun",
      openid: (t = wx.getStorageSync("COOK_U")).openid,
      t: o.data.t,
    };
    n.empty(i) ||
      (s = JSON.parse(
        (JSON.stringify(s) + JSON.stringify(i)).replace(/}{/, ",")
      )),
      e.ajax({
        url: "qun.php",
        data: s,
        success: function (t) {
          var i;
          ((r = !0), wx.hideLoading(), 1 == t.flag)
            ? (wx.setNavigationBarTitle({ title: t.nTitle }),
              0 == t.LIST.length
                ? o.setData({
                    LIST: [],
                    nodata: !0,
                    SO: t.SO,
                    nTitle: t.nTitle,
                    SHARE: t.SHARE,
                  })
                : o.setData(
                    (a((i = {}), "LIST[0]", t.LIST),
                    a(i, "trendSO", t.SO),
                    a(i, "nTitle", t.nTitle),
                    a(i, "SHARE", t.SHARE),
                    i)
                  ))
            : "nologin" == t.flag
            ? wx.navigateTo({ url: "../login/login" })
            : wx.showToast({ title: t.msg, icon: "none", mask: !0 });
        },
      });
  },
  tFn: function (t) {
    var i = this,
      a = t.currentTarget.dataset.t;
    2 == a
      ? e.chklogin().then(function (t) {
          t ? i.tFninit(a) : wx.navigateTo({ url: "../login/login" });
        })
      : i.tFninit(a);
  },
  tFninit: function (t) {
    this.setData({
      triggered: !1,
      loading_flag: !1,
      loading_str: "拼命加载中",
      LIST: [],
      nodata: !1,
      t: t,
      keyword: "",
    }),
      (i = {}),
      this.init();
  },
  getPhoneNumber: function (t) {
    e.getPhoneNumber({ e: t, url: "../reg/reg", urlkind: "navigateTo" });
  },
  back: function () {
    this.setData({ div_login: !1 });
  },
  nodatabackFn: function () {
    this.setData({
      triggered: !1,
      loading_flag: !1,
      loading_str: "拼命加载中",
      LIST: [],
      nodata: !1,
      t: 0,
      keyword: "",
    }),
      (i = {}),
      this.init();
  },
  soFn: function () {
    this.setData({
      div_right_mask_class: "alpha0_100",
      div_right_box_class: "div_leftAnm1",
      div_right_flag: !0,
    });
  },
  SO_uid_bindblurFn: function (t) {
    var i = t.detail.value;
    this.setData({ keyword: i });
  },
  div_right_boxFn: function () {},
  trend_form_uid_submitFn: function (t) {
    var a = t.detail.value.keyword;
    (i = { keyword: a }), this.div_right_close_Fn(), this.init();
  },
  trend_input_uid_submitFn: function (t) {
    var a = t.detail.value;
    (i = { keyword: a }), this.div_right_close_Fn(), this.init();
  },
  trend_form_ext_liFn: function (t) {
    var i,
      e = t.currentTarget.dataset.idx,
      o = t.currentTarget.dataset.v,
      r = t.currentTarget.dataset.fkind,
      s = this.data.trendSO[e].v;
    (i = n.empty(s)
      ? o
      : "checkbox" == r
      ? n.indexOf(s, o)
        ? (i = n.json_remove(s, o)).join(",")
        : s + "," + o
      : o),
      0 == o && (i = 0),
      this.setData(a({}, "trendSO[" + e + "].v", i));
  },
  trend_form_ext_submitFn: function (t) {
    ((i = t.detail.value).keyword = this.data.keyword),
      this.div_right_close_Fn(),
      this.init();
  },
  trend_form_ext_resetFn: function (t) {
    var i = this.data.trendSO;
    for (var n in i) this.setData(a({}, "trendSO[" + n + "].v", 0));
    this.setData({ keyword: "" });
  },
  trend_soFn: function () {
    this.setData({
      div_right_mask_class: "alpha0_100",
      div_right_box_class: "div_leftAnm1",
      div_right_flag: !0,
    });
  },
  div_right_close_Fn: function () {
    var t = this;
    this.setData({
      div_right_mask_class: "alpha100_0",
      div_right_box_class: "div_leftAnm2",
    }),
      setTimeout(function () {
        t.setData({ div_right_flag: !1 });
      }, 500);
  },
  onPullDownRefresh: function () {
    var t = this;
    wx.vibrateShort({ type: "heavy" }),
      setTimeout(function () {
        t.setData({
          triggered: !1,
          loading_flag: !1,
          loading_str: "拼命加载中",
          LIST: [],
          nodata: !1,
          t: 0,
          keyword: "",
        }),
          t.setloading("end", "拼命加载中"),
          (o = 2),
          (i = {}),
          t.init();
      }, 500);
  },
  setloading: function (t, i) {
    "start" == t
      ? this.setData({ loading_flag: !0, loading_ico_flag: !0, loading_str: i })
      : this.setData({
          loading_flag: !1,
          loading_ico_flag: !1,
          loading_str: i,
        });
  },
  onReachBottom: function () {
    var i = this.data.LIST,
      n = this;
    if (r) {
      (r = !1), n.setloading("start", "拼命加载中");
      var s = { submitok: "qun", p: o, openid: t.openid, t: n.data.t };
      e.ajax({
        url: "qun.php",
        data: s,
        success: function (t) {
          if (1 == t.flag) {
            var e = i.length;
            if (t.LIST.length < 1)
              return n.setloading("end", "已全部加载完毕"), void (r = !1);
            n.setData(a({}, "LIST[" + e + "]", t.LIST)), (o += 1), (r = !0);
          } else wx.showToast({ title: t.msg, icon: "none", mask: !0 });
          n.setloading("end", "上拉加载更多");
        },
      });
    }
  },
  binnd_scroll: function (t) {
    t.detail.scrollTop > 100
      ? this.setData({ backtop_flag: !0 })
      : this.setData({ backtop_flag: !1 });
  },
  backtopFn: function (t) {
    var i = "scrolltopNum_" + t.currentTarget.dataset.id;
    this.setData(a({}, i, 0));
  },
  onShareAppMessage: function (t) {
    return {
      imageUrl: this.data.SHARE.imgurl,
      title: this.data.SHARE.title,
      path: "/pages/qun/qun",
    };
  },
  onShareTimeline: function () {
    return {
      imageUrl: this.data.SHARE.imgurl,
      title: this.data.SHARE.title,
      query: "",
      path: "/pages/qun/qun",
    };
  },
});
